document.querySelector(".new-area-box").onclick=function(event){
    var element= event.target;
    var nodename=element.nodeName // div, a span ???
    
    console.log(element)
    console.log(nodename)
    
    // element.className="suzhou current"
    if(nodename == 'A'){
        var  SuArr=document.querySelector(".new-area-box").children;
        for(var i=0;i<SuArr.length;i++){
            SuArr[i].className="suzhou";

        }
        element.className="suzhou current"
        console.log("x选中的值"+element.innerText)
    }
}





    


   /*地图伸展*/
   $(".map-button-open").click(function () {
    $(this).hide();
    $(".main-box-left").show();
    $(".map-button-close").show();
    $(".main-box-right").removeClass("main-box-right-full");
});

$(".map-button-close").click(function () {
    $(this).hide();
    $(".main-box-left").hide();
    $(".map-button-open").show();
    $(".main-box-right").addClass("main-box-right-full");
});
$(".map-button-open").click(function () {
    $(this).hide();
    $(".main-box-left").show();
    $(".map-button-close").show();
    $(".main-box-right").removeClass("main-box-right-full");
});

    var map = new AMap.Map('container',{
        zoom: 15,
        center: [120.58,31.30]//设置地图的经纬度
    });




var marker1 = new AMap.Marker({
    position: new AMap.LngLat(120.58,31.30),
    icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
    anchor: 'bottom-center',
});
map.add(marker1);



var marker2 = new AMap.Marker({
    position: new AMap.LngLat(120.57,31.32),
    icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
    anchor: 'bottom-center',
});
map.add(marker2);


var marker3 = new AMap.Marker({
    position: new AMap.LngLat(120.43,31.31),
    icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
    anchor: 'bottom-center',
});
map.add(marker3);
var marker4 = new AMap.Marker({
    position: new AMap.LngLat(120.56,31.27),
    icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
    anchor: 'bottom-center',
});
map.add(marker4);

var marker5 = new AMap.Marker({
    position: new AMap.LngLat(120.57,31.34),
    icon: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
    anchor: 'bottom-center',
});
map.add(marker5);


$("#b1").bind("click",function(){
    var lng = 120.58;
    var lat = 31.30;
    map.setCenter([lng, lat]); 
})
$("#b2").bind("click",function(){
    var lng = 120.57;
    var lat = 31.32;
    map.setCenter([lng, lat]); 
})
$("#b3").bind("click",function(){
    var lng = 120.43;
    var lat = 31.31;
    map.setCenter([lng, lat]); 
})
$("#b4").bind("click",function(){
    var lng = 120.56;
    var lat = 31.27;
    map.setCenter([lng, lat]); 
})
$("#b5").bind("click",function(){
    var lng = 120.57;
    var lat = 31.34;
    map.setCenter([lng, lat]); 
})

marker1.on('click', function () {
    layer.tab({
        area: ['600px', '300px'],
        tab: [{
            title: '苏州新区高铁站送车点',
            content: '苏州城南路与虚链路交叉口西南100米',
           
        }
        ]
    });
})

marker2.on('click', function () {
    layer.tab({
        area: ['600px', '300px'],
        tab: [{
            title: '苏州新区高铁站送车点',
            content: '苏州城南路与虚链路交叉口西南100米',
           
        }
        ]
    });
})


marker3.on('click', function () {
    layer.tab({
        area: ['600px', '300px'],
        tab: [{
            title: '苏州新区高铁站送车点',
            content: '苏州城南路与虚链路交叉口西南100米',
           
        }
        ]
    });
})

marker4.on('click', function () {
    layer.tab({
        area: ['600px', '300px'],
        tab: [{
            title: '苏州新区高铁站送车点',
            content: '苏州城南路与虚链路交叉口西南100米',
           
        }
        ]
    });
})


marker5.on('click', function () {
    layer.tab({
        area: ['600px', '300px'],
        tab: [{
            title: '苏州新区高铁站送车点',
            content: '苏州城南路与虚链路交叉口西南100米',
           
        }
        ]
    });
})